<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>小儿推拿</title>
    <%@ include file="/include/datetables.jsp"%>

    <style>
        .tdHeight{
            line-height: 20px;
        }
    </style>
</head>
<body>
<div class="Baby_Healthy_home">
    <!--左侧-->
    <jsp:include page="/include/menu.jsp" flush="true">
        <jsp:param name="index" value="4"/>
    </jsp:include>
    <!--右侧-->
    <div class="Baby_Healthy_home_right">
        <div class="Baby_Healthy_home_right_top">
            <ul class="Baby_Healthy_home_right_top_list">
                <li class="num1 js_power_54"><a href="${pageContext.request.contextPath}/patient/gotoUserlib">宝宝中心</a></li>
                <li class="num2 bespeak_active js_power_55"><a href="${pageContext.request.contextPath}/patient/gotoTreatStat">病历管理</a></li>
            </ul>
        </div>
        <div class="Baby_Healthy_home_right_bespeak_list userlib" id="treatcase">
            <div class="bespeak_search_container">
                <div class="bespeak_search_container_seive">
                    <div class="form-inline search_choice_elm">
                        <label class="search_label selDate">日期筛选：
                            <input id="startDate" type="text" class="form-control selstart" placeholder="请选择开始日期">
                            <span>&nbsp;至&nbsp;</span>
                            <input id="endDate" type="text" class="form-control selend"  placeholder="请选择结束日期">
                        </label>
                    </div>
                    <div class="form-inline search_choice_elm">
                        <label class="search_label">选择门店：</label>
                        <select  type="text" class="form-control select_arrow subclinic js_power_45" id="subclinic" placeholder="请选择门店">
                            <option value="0">全部门店</option>
                        </select>
                    </div>
                </div>
                <div class="pd_t0">
                    <table class="zctable table table-striped table-no-bordered table-hover treatcase_list">
                        <thead class="">
                            <th class="">主症</th>
                            <th class="">病症次数</th>
                            <th class="">发病率</th>
                            <th class="">病状程度1</th>
                            <th class="">病状程度2</th>
                            <th class="">病状程度3</th>
                            <th class="">病状程度4</th>
                            <th class="">病状程度5</th>
                            <th class="">病状程度6</th>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script src="${pageContext.request.contextPath}/js/zcbase.js"></script>
<script>

    $('.Baby_Healthy_home_right_top_list>li').on('click', function () {
        $(this).addClass('bespeak_active').siblings().removeClass('bespeak_active');
    });
    $('.num2').on('click', function () {
        $('#userlib').hide();
        $('#treatcase').show();
    });
    function getSearchData(){
        var searchData = {};
        searchData.startTime = $("#startDate").val();
        searchData.endTime = $("#endDate").val();
        searchData.subclinicId = $("#subclinic").val();
        return searchData;
    };
    //时间筛选组
    baseFn.dateTimePickGroup('.selDate', {
        startseled: function () {
            var datas = getSearchData();
            treatcasesDT.settings()[0].ajax.data = datas;
            treatcasesDT.ajax.reload();
        },
        endseled: function () {
            var datas = getSearchData();
            treatcasesDT.settings()[0].ajax.data = datas;
            treatcasesDT.ajax.reload();
        }
    })
    //门店下拉框改变
    $("select#subclinic").change(function () {
        var datas = getSearchData();
        treatcasesDT.settings()[0].ajax.data = datas;
        treatcasesDT.ajax.reload();
    })

    //病历管理列表（表格）
    var treatcasesDT = baseFn.rpDataTables('.treatcase_list',{
        ajUrl:baseUrl.base+baseUrl.patient+'selectDiseaseBook',
        ajDataSrc:"results",
        ajData:{
            subclinicId:SessionData.powerSub?SessionData.powerSub:0
        },
        select:false,
        scrollY:windowOffsetData.tableHeight(),
        autoWidth:false,
        columns:[
            {"data":"typeName",width:'8%',defaultContent:'',className:''},
            {"data":"typeCount",width:'7%',defaultContent:'',className:''},
            {"data": "typeRaion",width:'7%',defaultContent:'',className:'',render:function(data,type,row, meta){

                    return floatObj.multiply(data, 100) + "%";
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[0];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[1];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[2];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[3];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[4];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }},
            {"data": "diseaseList",defaultContent:'',width:'13%',className:'tdHeight',render:function(data,type,row, meta){
                    var disData = data[5];
                    var html = disData.diseaseName + "<br/>发病次数：" + disData.diseaseCount + "<br/>发病率：" + floatObj.multiply(disData.diseaseRaion, 100) + "%";
                    return html;
                }}

        ],
        initComplete:function(){
        },
        drawCallback: function( settings ) {

        }
    })

    //门店下拉列表
    baseFn.rpSelect('.subclinic',{
        url: baseUrl.base + "subclinic/selectSubclinicList",
        idKey:"subclinicId",
        textKey:'subclinicName',
        calFn:function(){
            //权限管理 45 全部门店
            if(SessionData.powerSub){
                $('.subclinic').val(SessionData.powerSub).trigger('change')
            }
        },
        selFn:function(e){
            var datas = getSearchData();
            treatcasesDT.settings()[0].ajax.data = datas;
            treatcasesDT.ajax.reload();
        }
    })
    //表格自适应
window.onresize = function(){
    windowOffsetData.refresh();
    $(treatcasesDT.table().body()).parents('.dataTables_scrollBody').css('max-height',windowOffsetData.tableHeight());
    treatcasesDT.draw(false);
}
</script>
</html>